home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 August / Ahoy_Magazine_86-08_1986_Double_L.d64 / Elegant Encoder (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  415b  |  16 lines

  1. 1 print"[147]":poke53280,6:poke53281,1:poke646,0
  2. 2 printtab(5)"commodares...elegant encoder"
  3. 3 rem solution by
  4. 4 rem     frank t. smith
  5. 5 rem
  6. 10 dim m(25)
  7. 20 print"input word to be encoded"
  8. 30 get i$:if i$="" then 30
  9. 40 if i$=chr$(13) then 70
  10. 50 if i$<"@" or i$>"\" then 30
  11. 60 print i$; : n=n+1 : m(n)=asc(i$)-64 :goto 30
  12. 70 for a=1 to n:for b=1 to n:if a<>b then t=t+m(b)
  13. 80 next b
  14. 90 c$=c$+chr$(t-int(t/29)*29+64) : t=0 :next a
  15. 100 print:print"coded word is ";c$:print:print:n=0:c$="":goto 20
  16.